import request from "@/util/http";
import qs from "qs";

export default {
  //渲染页面接口
  gain(forms) {
    return request({
      method: "get",
      params: {
        _gp: "admin.order",
        _mt: "list",
        page: forms.pageNo,
        limit: forms.limit,
        status: forms.status,
        orderNo: forms.orderNo
      }
    });
  },
  //详情页面接口
  particulars(form) {
    return request({
      method: "get",
      params: {
        _gp: "admin.order",
        _mt: "detail",
        orderId: form.orderId
      }
    });
  },
  innerredact(form) {
    return request({
      method: "post",
      data: qs.stringify({
        _gp: "admin.order",
        _mt: "editAdminMono",
        orderId: form.orderId, //id
        level: form.adminMonoLevel, //选择颜色
        mono: form.adminMono //内容
      })
    });
  },
  //发货接口
  deliver(form) {
    return request({
      method: "post",
      data: qs.stringify({
        _gp: "admin.order",
        _mt: "ship",
        orderNo: form.orderNo,
        shipCode: form.shipCode,
        shipNo: form.shipNo
      })
    });
  },
  //退款
  refund(form) {
    return request({
      method: "get",
      params: {
        _gp: "admin.order",
        _mt: "refund",
        orderNo: form.orderNo,
        type: form.type
      }
    });
  },
  //导出接口
  exporInterface(form) {
    return request({
      method: "get",
      params: {
        _gp: "admin.order",
        _mt: "queryToExcel",
        gmtStart: form.gmtStart, //查询开始时间
        gmtEnd: form.gmtEnd, //查询结束时间
        status: form.warehouse
      }
    });
  }
};
